package com.zjh.Guide.model.page;

import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Record;
import com.yaowk.common.model.Page;

/**
 * Created by zZz on 2017/5/24 0024.
 */
public class NotificationPage extends Page {
    private Integer columnId;
    private String beginTime;
    private String endTime;
    private String title;

    public Integer getColumnId() {
        return columnId;
    }

    public void setColumnId(Integer column_id) {
        columnId = column_id;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public Record toRecord() {
        Record record = new Record()
                .set("columnId", columnId)
                .set("beginTime", beginTime)
                .set("endTime", endTime);
        if (StrKit.notBlank(title)) {
            record.set("title", "%" + title + "%");
        }
        return record.removeNullValueColumns();
    }

}
